package com.xiaoge.basedevlibrary.base;

import android.os.Bundle;

import com.jude.swipbackhelper.SwipeBackHelper;

/**
 * Created by guoyzh on 2018/3/23 0023.
 * 可以右滑返回的activity
 *
 * 主题style文件中添加下列属性
 */

public class GuoBaseBackActivity extends GuoBaseActivity {

    /*<item name="android:windowBackground">@android:color/transparent</item>
    //背景透明，不设滑动关闭时背景就是黑的。
    <item name="android:windowIsTranslucent">true</item>
    //Activity右滑进出的动画，觉得这个不好看随便换成自己的
    <item name="android:windowAnimationStyle">@style/SlideRightAnimation</item>*/

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // 添加右滑返回功能
        SwipeBackHelper.onCreate(this);
    }

    @Override
    protected void onPostCreate(Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);
        SwipeBackHelper.onPostCreate(this);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        SwipeBackHelper.onDestroy(this);
    }
}
